export default class AI extends Laya.Script {
    /** @prop {name:player, tips:"布尔类型示例", type:Node, default:null}*/
    player=null;
    sign=" ";
    // 更多参数说明请访问: https://ldc2.layabox.com/doc/?nav=zh-as-2-4-0
    
    constructor() { super(); }
    onAwake(){
        this.player=this.owner.parent.getChildByName("player")
    }
    Init(sign){
        this.sign=sign;
        }
    onUpdate(){
        Laya.Tween.to(this.owner,{x:this.player.x,y:this.player.y},50,null,null,null,true);
    }
    onTriggerEnter(other){
        if(other.label=="player"){
            this.owner.removeSelf();
            Laya.Pool.recover(this.sign,this.owner); 
        }
    }
}